import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
	path: '/',
	redirect:'/recommendation',//重定向路由
	component: () => import(/* webpackChunkName: "index" */ '../views/index'),
	children: [
		{
		  // 当 /index/:id/recommendation 匹配成功，
		  path: 'recommendation',
		//   alias:'/',//别名 重定向 将该组件页面显示在想显示的地方
		  component: () => import(/* webpackChunkName: "recommendation" */ '../views/index/recommendation')
		},
		{
			// 当 /index/:id/video 匹配成功
			path: '/music',
			name:'music',
			component: () => import(/* webpackChunkName: "video" */ '../views/index/music')
		  },
		{
		  // 当 /index/:id/video 匹配成功
		  path: '/videos',
  
		  component: () => import(/* webpackChunkName: "video" */ '../views/index/videos')
		}
	  ]
},
{
	path: '/login',
	component: () => import(/* webpackChunkName: "login" */ '../views/login')
},
{
	path: '/search',
	component: () => import(/* webpackChunkName: "search" */ '../views/search')
},
{
	path: '/radio',
	redirect:'/radio/recommendation',
	component: () => import(/* webpackChunkName: "radio" */ '../views/radio'),
	children: [
		{
		  // 当 /index/:id/recommendation 匹配成功，
		  path: '/radio/recommendation',
		//   alias:'/radio',//别名 重定向 将该组件页面显示在想显示的地方
		  component: () => import(/* webpackChunkName: "recommendation" */ '../views/radio/recommendation')
		},
		{
			// 当 /index/:id/video 匹配成功
			path: '/blogs',
	
			component: () => import(/* webpackChunkName: "video" */ '../views/radio/blogs')
		  }
	]

},
{
	path: '/my',
	component: () => import(/* webpackChunkName: "login" */ '../views/my')
},
{
	path: '/play',
	component: () => import(/* webpackChunkName: "login" */ '../views/play')
},
{
	path: '/heartbeat',
	component: () => import(/* webpackChunkName: "login" */ '../views/heartbeat')
}
]

const router = new VueRouter({
  routes
})

export default router
